<template>
  <div>
    <div class="news_title">
      <div class="news">
        <h1>人气推荐</h1>
        <span>人气爆款 不容错过</span>
      </div>
    </div>
    <div class="goods_list">
      <div class="list_one" v-for="(item, index) in hotList" :key="index">
        <img :src="item.picture" alt="" />
        <h2>{{ item.title }}</h2>
        <p class="price">{{ item.alt }}</p>
      </div>
    </div>
  </div>
</template>
<script>
import { _getHot } from '../../../api/home'
export default {
  data () {
    return {
      hotList: [] //热门推荐数据
    }
  },
  created () {
    this.getHot()
  },
  methods: {
    async getHot () {
      var res = await _getHot()
      console.log(res)
      this.hotList = res.data.result
    }
  }
}
</script>
<style lang="less">
.news_title {
  width: 1240px;
  height: 60px;
  margin: 0 auto;
  line-height: 60px;
  display: flex;
  justify-content: space-between;
  .news {
    display: flex;
  }
}
.goods_list {
  width: 1240px;
  margin: 0 auto;
  height: 406px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  .list_one {
    width: 306px;
    height: 406px;
    img {
      width: 306px;
      height: 306px;
    }
    h2 {
      line-height: 60px;
    }
    .price {
      color: red;
      font-size: 18px;
    }
  }
}
</style>
